//1200.最小绝对差
//https://leetcode.cn/problems/minimum-absolute-difference/
class Solution {
public:
    vector<vector<int>> minimumAbsDifference(vector<int>& arr) {
        sort(arr.begin(),arr.end());
        vector<vector<int>> ret;
        int n = arr.size();
        int mindiff = INT_MAX;
        int diff = 0;
        for(int i = 1;i<n;++i)
        {
            diff = abs(arr[i]-arr[i-1]);
            if(diff == 0) continue;
            if(diff < mindiff)
            {
                mindiff = diff;
                ret.clear();
                ret.push_back({arr[i-1],arr[i]});
            }
            else if(diff == mindiff) ret.push_back({arr[i-1],arr[i]});
        }
        return ret;
    }
};